package com.duan.blog.common;

import com.duan.blog.constants.CodeEnum;
import lombok.Data;

@Data
public class CustomException extends RuntimeException{
    private Integer code;

    public CustomException(Integer code, String msg){
        super(msg);
        this.code = code;
    }

    public CustomException(CodeEnum codeEnum){
        super(codeEnum.getMsg());
        this.code = codeEnum.getCode();
    }
}
